<template>
	<view class="auth">
		<view class="Check">
			<image src="/static/check.png"></image>
			<view>你的账号信息(昵称、头像、地区及性别)</view>
		</view>
		<image class="login" src="/static/yy.jpg"></image>
		<view class="grant">
			<button type="primary" open-type="getUserInfo" lang="zh_CN" @getuserinfo="getUserInfo">允许授权</button>
			<view @click="OngetUserInfo">不允许</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				Signin: false
			}
		},
		onLoad: function(options) {
			this.Signin = options.Signin == 'true' ? true : false
		},
		methods: {
			//获取用户授权信息回调
			getUserInfo(e) {
				if (e.detail.rawData) {
					uni.setStorage({
						key: 'userInfo',
						data: e.detail.userInfo,
					})
				}
				if (this.Signin) {
					wx.redirectTo({
						url: '/pagesA/common/Signin'
					})
				} else {
					wx.navigateBack({
						delta: 1
					})
				}
			},
			//用户拒绝
			OngetUserInfo() {
				uni.navigateBack({
					delta: 1
				})
			}
		}
	}
</script>

<style>
	.auth {
		width: 750rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.Check {
		display: flex;
		height: 42rpx;
		align-items: center;
		margin-top: 120rpx;
	}

	.Check image {
		width: 34rpx;
		height: 34rpx;
		margin-right: 20rpx;
	}

	.Check view {
		font-size: 32rpx;
		color: #323232;
	}

	.grant {
		height: 416rpx;
		width: 750rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-top: 120rpx;
		/* position: fixed;
  bottom: 0; */
	}

	.grant button {
		width: 332rpx;
		height: 76rpx;
		background-color: #55c06a;
		border-radius: 5rpx;
		font-size: 32rpx;
		color: #ffffff;
		line-height: 76rpx;
	}

	.grant view {
		width: 332rpx;
		height: 76rpx;
		background-color: #f2f2f2;
		border-radius: 5rpx;
		text-align: center;
		line-height: 76rpx;
		font-size: 32rpx;
		color: #55c06a;
		margin-top: 28rpx;
	}

	.login {
		margin-top: 200rpx;
		width: 300rpx;
		height: 300rpx;
	}
</style>
